//
// Created by Tony on 2024/6/22.
//

#ifndef PARSER_RETURN_STMT_H
#define PARSER_RETURN_STMT_H

#include "../../AstList.h"

namespace Parser {

class ReturnStmt : public AstList {
    string nodeName;

public:
    ReturnStmt() : AstList({}) { nodeName = __func__; }

    explicit ReturnStmt(const vector<shared_ptr<Ast>>& children) : AstList(children) {
        nodeName = __func__;
    }

    shared_ptr<Ast> getReturnExpr() { return children.empty() ? nullptr : child(0); }

    int32_t accept(Compiler::Visitor* visitor) override;
};

} // namespace Parser

#endif // PARSER_RETURN_STMT_H
